def add():
    count = 1
    def fun():
        nonlocal count
        print(count)
        count += 1
    return fun